<<<<<<< HEAD
int removeDuplicates(int* nums, int numsSize) 
{
	int right = 1;
	int left = -1;
	int k = 0;
	int num = 0;
	while (right < numsSize)
	{
		while (nums[right] == nums[right - 1])
		{
			++k;
			++right;
		}
		if (k == 1||((k==0)&&(nums[right]!=nums[right-1])))
		{
			nums[++left] = nums[right - 1];
			++num;
		}
		else if (k > 1)
		{
			nums[++left] = nums[right - 1];
			nums[++left] = nums[right - 1];
			num += 2;
		}
		k = 0;
		right++;
	}
	return num;
=======
int removeDuplicates(int* nums, int numsSize)
{
	int *left = nums+1;
	int *right = nums+1;
	if (numsSize == 0)
		return 0;
	else if (numsSize == 1)
		return 1;
	while (right < nums + numsSize)
	{
		if(*right>*left)
		{
			*left = *right;
			++left;
		}
		++right;
	}
	return left - nums;
>>>>>>> 98f6bf4b818434b7e45454ee7f8e80dc372ebe72
}

int removeDuplicates(int* nums, int numsSize)
{
<<<<<<< HEAD
	if (numsSize <= 2)
		return numsSize;
	int right = 2;
	int left = 2;
	while (right < numsSize)
	{
		if (nums[left - 2] != nums[right])
		{
			nums[left] = nums[right];
			++left;
		}
		right++;
	}
	return left;
=======
	int left = 0;
	int right = 1;
	if (numsSize == 0)
		return 0;
	else if (numsSize == 1)
		return 1;
	while (right < numsSize)
	{
		if (nums[right] > nums[left])
		{
			nums[++left] = nums[right];
		}
		++right;
	}
	return left + 1;
>>>>>>> 98f6bf4b818434b7e45454ee7f8e80dc372ebe72
}